package Coffee.controller;

import Coffee.bean.Order;
import Coffee.dao.OrderDao;
import Coffee.dao.OrderDaoImpl;
import Coffee.dao.UserDao;
import Coffee.dao.UserDaoImpl;
import Coffee.service.OrderService;
import Coffee.service.OrderServiceImpl;
import Coffee.service.UserService;
import Coffee.service.UserServiceImpl;

import java.util.List;

public class Test4 {
    public static void main(String[] args) {
        UserDao userDao = new UserDaoImpl();
        UserService userService = new UserServiceImpl();
        OrderDao orderDao = new OrderDaoImpl();
        OrderService orderService = new OrderServiceImpl();
       //充值
       // userService.insertMoney(100,"admin1");
        //查询余额
        userService.queryMoneyByUsername("admin");
        //消费-钱包
        userService.updateMoney(100,"admin");
        //根据name和状态查询订单
        List<Order> orders = orderService.queryOrderByState("admin", "制作中");
        orders.iterator().forEachRemaining(System.out::println);
        //修改订单状态
        //orderService.updateOrderState("制作中", "c3aa9c67c9ec415391f947212a9e24c3");
        //根据Orderid查询单个订单
        System.out.println(orderService.queryOrderByOrderId("c3aa9c67c9ec415391f947212a9e24c3"));


    }
}
